<div class="underlying" style="width:100%;display: flex;flex-direction: row;flex-wrap: wrap;">
  <div class="table">
    <!-- 头部Table -->
    <nz-table #nestedTable style="border-collapse:collapse;border-radius:4px 4px 0px 0px;"
      [nzScroll]="{x:'2260px',y:'750px'}" [nzData]="tempData" class="designTable" [nzShowPagination]='false'>
      <thead class="tableHeard" style="text-align: center !important;">
        <tr style="text-align: center !important;">
          <th nzWidth="40px"></th>
          <th nzWidth="40px"></th>
          <th nzWidth="40px"></th>
          <th nzWidth="40px"></th>
          <th nzWidth="50px"></th>
          <th nzWidth="150px">
            <!-- 總檢狀態 -->
            <button nz-button nzTrigger="click" nz-dropdown [nzDropdownMenu]="menu4">總檢狀態
              <i nz-icon nzType="down"></i>
            </button>
            <nz-dropdown-menu #menu4="nzDropdownMenu" class="drop">
              <ul nz-menu class="dropdownMenu">
                <li nz-menu-item class="Li">
                  <nz-radio-group [(ngModel)]="radioValue">
                    <label nz-radio [ngStyle]="style" nzValue="全部狀態" (click)="doingForm()">全部狀態</label>
                    <label nz-radio [ngStyle]="style" nzValue="待總檢" (click)="doingForm()">待總檢</label>
                    <label nz-radio [ngStyle]="style" nzValue="總檢中" (click)="doingForm()">總檢中</label>
                    <label nz-radio [ngStyle]="style" nzValue="已總檢" (click)="doingForm()">已總檢</label>
                    <label nz-radio [ngStyle]="style" nzValue="已總檢/NG" (click)="doingForm()">已總檢/NG</label>
                  </nz-radio-group>
                </li>
              </ul>
            </nz-dropdown-menu>
          </th>

          <th nzWidth="250px">工聯單號</th>
          <th nzWidth="230px">治具名稱</th>
          <th nzWidth="150px">數量</th>
          <th nzWidth="230px">19碼</th>

          <th nzWidth="150px">總檢提醒</th>

          <th nzWidth="200px">送檢時間</th>
          <th nzWidth="150px">
            <div>總檢結果</div>
            <div style="width: 70px; float: left;">NG數</div>
            <div style="width: 70px; float: right;">OK數</div>
          </th>
          <th nzWidth="220px">工作時間統計</th>
          <th nzWidth="150px">治具交期</th>
          <th>總檢備註</th>
        </tr>
      </thead>
      <!-- 工联单Table -->
      <tbody class="tablecontent" style="border-left: 1px solid rgba(71,156,156,1) !important;">
        <ng-container *ngFor="let item of tempData let bigkey = index">
          <tr id="first" *ngIf=isshow[bigkey]>
            <td style="min-width:40px;">
              <a *ngIf="item.songjian_time == ''" class="new"></a>
            </td>
            <td style="min-width:40px;">
              <a class="attich" (click)="downLoad(item)" title="文件信息"></a>
            </td>
            <td style="min-width:40px;text-align: center">
              <a class="return" (click)="return(item)" title="退回"></a>
            </td>
            <!-- 送出 -->
            <td style="min-width:40px;">
              <a class="send" (click)="send(item)" title="送出"></a>
            </td>

            <td nzShowExpand [(nzExpand)]="item.expand" style="color: rgba(48,73,77,1);min-width:50px;"
              (nzExpandChange)="QueryWorkOrder(bigkey)"></td>
            <!-- 總監狀態 -->
            <td style="min-width:150px;">
              <span style="color:#FACA00" *ngIf="allof[bigkey]=='0'">待總檢</span>
              <span style="color:#ffffff" *ngIf="allof[bigkey]=='1'">總檢中</span>
              <span style="color:#21CC97" *ngIf="allof[bigkey]=='3'">已總檢</span>
              <span style="color:#21CC97" *ngIf="allof[bigkey]=='2'">已總檢/NG</span>
            </td>
            <td class="fontColor" style="min-width:250px;">
              <span
                style=" text-overflow: -o-ellipsis-lastline;
              overflow: hidden; text-overflow: ellipsis;display: -webkit-box; -webkit-line-clamp: 1;line-clamp: 1;-webkit-box-orient: vertical; text-align: left; cursor: pointer;width: 240px;">
                {{item.union_order}}
              </span>
            </td>

            <!-- 治具名稱 -->
            <td style="min-width:230px;">
              <span
                style=" text-overflow: -o-ellipsis-lastline;
              overflow: hidden; text-overflow: ellipsis;display: -webkit-box; -webkit-line-clamp: 1;line-clamp: 1;-webkit-box-orient: vertical; text-align: left; cursor: pointer;width: 220px;"
                title={{item.name}}>
                {{item.name}}
              </span>
            </td>
            <!-- 數量 -->
            <td style="min-width:150px;">{{item.quatity}}</td>
            <!-- 19码悬浮框 -->
            <td *ngIf="item.code19.split(',')[1]"
              style="min-width: 230px !important;text-align: left;text-indent: 10px;"
              title={{item.code19.split(splitJudge)[0]}}~{{item.code19.split(splitJudge)[1]}}>
              {{item.code19.split(",")[0]}}
            </td>
            <td *ngIf="!item.code19.split(',')[1]" style="min-width:230px;text-align: left;text-indent: 10px; ">
              {{item.code19.split(",")[0]}}
            </td>
            <!-- 總監提醒 -->
            <td style="min-width:150px;">
              <span style="color:#FF4848" *ngIf=alltitle[bigkey]>
                Delay
              </span>
            </td>

            <!-- 送檢時間 -->
            <td style="min-width:200px;">
              <a class="addDate" *ngIf="item.songjian_time==''" (click)="addDate(item)"></a>
              <span *ngIf="item.songjian_time!=''">{{item.songjian_time}}</span>
            </td>
            <!-- NG  OK -->
            <td style="min-width:150px;" (click)="addResultNum(item)">
              <span *ngIf="shows[bigkey]" class="addResultNum" (click)="addResultNum(item)"></span>
              <div *ngIf="!shows[bigkey]" style="width: 73px; float: left;color: #ff4848;">{{item.zongjian_ng_count}}
              </div>
              <div *ngIf="!shows[bigkey]" style="width: 73px; float: right;color: #21cc97;">{{item.zongjian_ok_count}}
              </div>
            </td>



            <td style="min-width:220px;align-items: center;" (click)="clickLine(bigkey,item.priority)">
              <div *ngIf="ishowerer[bigkey]">
                <span class="start" (click)="start(item,bigkey)"></span>
                <i>{{sfmtime}}</i>
                <span class="end" (click)="end(item,bigkey)"></span>
              </div>
            </td>



            <td style="min-width:150px;">{{item.delivery_date}}</td>
            <!-- 退單備註 -->
            <td *ngIf=" !item.zongjian_beizhu || item.zongjian_beizhu === '' " style="width: 200px;text-align: center;">
              <a class="addRemark" (click)="addRemark(item)" title=item.zongjian_beizhu></a>
            </td>
            <td *ngIf=" item.zongjian_beizhu != '' "
              style="min-width:200px;text-decoration:underline;cursor:pointer;text-align: left;" class="fontColor"
              (click)="addRemark(item)" title={{item.zongjian_beizhu}}>
              <span
                style=" text-overflow: -o-ellipsis-lastline;
                overflow: hidden; text-overflow: ellipsis;display: -webkit-box; -webkit-line-clamp: 1;line-clamp: 1;-webkit-box-orient: vertical; width: 190px;">
                {{item.zongjian_beizhu}}
              </span>
            </td>

          </tr>
          <tr [(nzExpand)]="item.expand">
            <td colspan="16" style="padding-left:0 !important;">
              <!-- 展开治具Table -->
              <nz-table #innerTable [nzData]="workData[bigkey]" nzSize="middle" [nzShowPagination]="false">
                <tbody class="downData" style="width: 100%;text-align: center !important;" *ngFor="let item2 of workData[bigkey] let key = index">
                  <tr  id="second" style="text-align: center !important;">
                    <td style="min-width:40px;">
                      <!-- <a class="warning" *ngIf="showWarning[bigkey][key]"></a> -->
                    </td>
                    <!-- 附件 -->
                    <td style="min-width:40px;">
                      <!-- <a class="attich2" (click)="downLoad(item2)"></a> -->
                    </td>
                    <!-- 退回 -->
                    <td style="min-width:40px;text-align: center">
                      <!-- <a class="return" (click)="return(item2)"></a> -->
                    </td>
                    <!-- 送出 -->
                    <td style="min-width:40px;">
                      <!-- <a class="send" (click)="send(item2)"></a> -->
                    </td>
                    <td *ngIf="item2.chaidan == 1 " nzShowExpand [(nzExpand)]="item2.expand" style="color: rgba(48,73,77,1);min-width:50px;"
                    (nzExpandChange)="QueryWorkOrder2(item2,bigkey,key)"></td>
                    <td *ngIf="item2.chaidan != 1 "  style="color: rgba(48,73,77,1) ; min-width:50px;" ></td>
                    <!-- 状态 -->
                    <td style="min-width:150px;text-align: center"></td>

                    <td style="min-width:250px;text-align: left" title="{{item2.sheet_order}}">
                      <span
                        style="text-overflow: -o-ellipsis-lastline;
                      overflow: hidden; text-overflow: ellipsis;display: -webkit-box; -webkit-line-clamp: 1;line-clamp: 1;-webkit-box-orient: vertical;text-align: left;width: 240px;">
                        {{item2.sheet_order}}</span>
                    </td>
                    <td style="min-width:230px;text-align: center"></td>

                    <!--數量 -->
                    <td style="min-width:150px;text-align: center;">{{item2.quatity_total}}</td>
                    <td style="min-width:230px;text-align: center"></td>

                    <!-- 提醒 -->
                    <td style="min-width:150px;text-align: center"></td>

                    <td style="min-width:200px;text-align: center"></td>
                    <td style="min-width:150px;text-align: center"></td>

                    <td style="min-width:220px;text-align: center"></td>

                    <!-- 实际时间 -->
                    <td style="min-width:150px;text-align: center"></td>
                    <td style="min-width:200px;text-align: center"></td>


                  </tr>
                  <tr [(nzExpand)]="item2.expand" *ngFor="let item3 of listfd[bigkey][key]">
                    <td style="background:#000;min-width:40px;"></td>
                    <td style="background:#000;min-width:40px;"></td>
                    <td style="background:#000;min-width:40px;text-align: center"></td>
                    <td style="background:#000;min-width:40px;"></td>
                    <td style="color: rgba(48,73,77,1) ; background:#000;min-width:50px;" ></td>
                    <td style="background:#000;min-width:150px;text-align: center"></td>
                    <td style="width:250px;text-align: left;background:#000;min-width: 230px;" title="{{item3.sheet_order}}">
                      <span style="text-overflow: -o-ellipsis-lastline;
                        overflow: hidden; text-overflow: ellipsis;display: -webkit-box; -webkit-line-clamp: 1;line-clamp: 1;-webkit-box-orient: vertical;text-align: left;width: 240px;">
                        {{item3.sheet_order}}</span>
                    </td>
                    <td style="background:#000;min-width:230px;text-align: center"></td>
                    <td style="background:#000;min-width:150px;text-align: center;">{{item3.gjsl}}</td>
                    <td style="background:#000;min-width:230px;text-align: center"></td>
                    <td style="background:#000;min-width:150px;text-align: center"></td>
                    <td style="background:#000;min-width:200px;text-align: center"></td>
                    <td style="background:#000;min-width:150px;text-align: center"></td>
                    <td style="background:#000;min-width:220px;text-align: center"></td>
                    <td style="background:#000;min-width:150px;text-align: center"></td>
                    <td style="background:#000;min-width:200px;text-align: center"></td>
                  </tr>
                </tbody>
              </nz-table>
            </td>
          </tr>
        </ng-container>
      </tbody>
    </nz-table>

    <!-- 添加编程备注 -->
    <nz-modal class="designRemark" [(nzVisible)]="addRemark1" nzTitle="總檢備註" (nzOnCancel)="CancelAddRemark()"
      (nzOnOk)="addRemarkOk()" [nzOkLoading]="isOkLoadingRemark" style="text-align:center"
      [nzMaskStyle]="{backgroundColor:'rbga(48,73,77,.05)'}"
      [nzBodyStyle]="{height:'200px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'20px',textAlign:'center',lineHeight:'20px'}">
      <div>
        <textarea nz-input [(ngModel)]="designRemark" [nzAutosize]="{ minRows: 2, maxRows: 6 }"
          class="deRemark"></textarea>
        <div style="margin:24px 0;"></div>
      </div>
    </nz-modal>

    <!-- 上传文件 -->
    <nz-modal [(nzVisible)]="fileInfom" nzTitle="文件信息" (nzOnCancel)="CancelShow()" (nzOnOk)="ShowOK()"
      [nzOkLoading]="isOkLoadingfileInfom" style="text-align:center" nzWidth='1000px'
      [nzBodyStyle]="{height:'600px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'18px',textAlign:'center',lineHeight:'20px'}">
      <!-- 加载中 -->
      <nz-spin [nzSize]="'large'" *ngIf="isLoading" style="position: absolute;width: 100vw;height: 100vh;margin-left: -25.5vw;margin-top: -16vh;">
      </nz-spin>
      <div style="text-align:left;border-bottom: 1px solid rgba(36,54,58,1);background: #30494d;">
        <div style="width:100% !important;height:1px;background: rgba(36,54,58,1);"></div>
        <input type="file" nv-file-select uploader="uploader"
          style="color:#ffffff; position: absolute;margin-left: 50px; ;margin-top: 16px;" value="点击上传文件" multiple
          (change)="openFile($event)">
        <a class="upload" (click)="Upload()"></a>
      </div>
      <div style="text-align:left;line-height: 45px;">
        <nz-table class="tb_file" #rowSelectionTable [nzShowPagination]="false" nzShowSizeChanger [nzData]="listOfData"
          (nzCurrentPageDataChange)="currentPageDataChange($event)" style="height: 540px;overflow: auto;">
          <thead>
            <tr style="height:20px;">
              <th style="min-width:250px;text-align:center">文件名稱</th>
              <th style="min-width:250px;text-align:center">上傳時間</th>
              <th style="min-width:100px;text-align:center">文件狀態</th>
              <th style="min-width:250px;text-align:center">備註</th>
              <th style="min-width:50px;text-align:center"></th>
            </tr>
          </thead>
          <tbody class="uploadTable">
            <tr *ngFor="let data of listOfData" class="list_hover" style="text-align: center !important;">
              <td style="width:250px;text-align:center;">
                <a [href]="link" [download]="data.file_name" (click)="downLoadFile(data)">
                  {{data.file_name}}
                </a>
              </td>
              <td style="width:250px;text-align:center">{{data.upload_time}}</td>
              <!-- 审核状态 -->
              <td style="width:100px;text-align:center" *ngIf="data.file_status === 0" ngDefaultControl>
                未审核
              </td>
              <td style="width:100px;text-align:center" *ngIf="data.file_status === 1" ngDefaultControl>
                已審核
              </td>
              <td style="width:100px;text-align:center" *ngIf="data.file_status === 2" ngDefaultControl>
                已退回
              </td>

              <td style="width:250px;text-align:center">{{data.remark}}</td>

              <td style="width:50px;text-align:center">
                <a class="delFile" (click)="showDelFile(data)"></a>
              </td>
            </tr>
          </tbody>
        </nz-table>
      </div>
    </nz-modal>

    <!-- 删除文件信息 -->
    <nz-modal [(nzVisible)]="isFileVisible" nzTitle="刪除" (nzOnCancel)="handleFileCancel()" (nzOnOk)="delFileOk()"
      [nzOkLoading]="isFileOkLoading" [nzMaskStyle]="{backgroundColor:'rbga(48,73,77,.05)'}"
      [nzBodyStyle]="{height:'200px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'20px',fontWight:'300',textAlign:'center',lineHeight:'200px'}">
      <p>確認刪除這個文件信息嗎？</p>
    </nz-modal>

    <!-- 文件退回 -->
    <nz-modal class="remark" [(nzVisible)]="addOtherRemark" nzTitle="退回" (nzOnCancel)="CancelRemark()"
      (nzOnOk)="RemarkOk()" [nzOkLoading]="isOkLoadingOthRemark" style="text-align:center"
      [nzMaskStyle]="{backgroundColor:'rbga(48,73,77,.05)'}"
      [nzBodyStyle]="{height:'200px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'20px',textAlign:'center',lineHeight:'20px'}">
      <div style="margin-top:0px">
        <textarea nz-input [(ngModel)]="RemarkValue" [nzAutosize]="{ minRows: 2, maxRows: 8 }"
          class="deRemark"></textarea>
      </div>
    </nz-modal>

    <!-- 送出 -->
    <nz-modal [(nzVisible)]="isSendVisible" nzTitle="送出" (nzOnCancel)="handleSendCancel()" (nzOnOk)="sendOk()"
      [nzOkLoading]="isSendOkLoading" [nzMaskStyle]="{backgroundColor:'rbga(48,73,77,.05)'}"
      [nzBodyStyle]="{height:'200px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'20px',fontWight:'300',textAlign:'center',lineHeight:'200px'}">
      <p>確認送出這個工件嗎？</p>
    </nz-modal>

    <!-- 送检时间 -->
    <nz-modal class="addTime" [(nzVisible)]="addTime" nzTitle="送檢時間" (nzOnCancel)="CancelAddTime()"
      (nzOnOk)="addTimeOk()" style="text-align:center" [nzMaskStyle]="{backgroundColor:'rbga(48,73,77,.05)'}"
      [nzBodyStyle]="{height:'200px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'20px',textAlign:'center',lineHeight:'20px'}">
      <div>
        <textarea nz-input [(ngModel)]="timetime" [nzAutosize]="{ minRows: 2, maxRows: 8 }" class="deRemark"></textarea>
        <div style="margin:24px 0;"></div>
      </div>
    </nz-modal>
    <!-- 工件檢測結果 -->
    <nz-modal class="add" [(nzVisible)]="checkResult" nzTitle="總檢結果" (nzOnCancel)="CancelAddResult()"
      (nzOnOk)="addCheckResult()" style="text-align:center" [nzMaskStyle]="{backgroundColor:'rbga(48,73,77,.05)'}"
      [nzBodyStyle]="{height:'230px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'20px',textAlign:'center',lineHeight:'20px'}">
      <span>NG: </span> &nbsp;
      <input type="text" [(ngModel)]="NGnum" name="value1" class="NGnum">
      <div style="margin:10%"></div>
      <span>OK: </span> &nbsp;
      <input type="text" [(ngModel)]="OKnum" name="value2" class="OKnum">
    </nz-modal>

  </div>
</div>
